package com.zhengke.service.cggl.impl;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.zhengke.common.object.Result;
import com.zhengke.dao.CGDHDao;
import com.zhengke.pojo.TvPurchaseDetails;
import com.zhengke.pojo.TvPurchaseTemporary;
import com.zhengke.service.cggl.CGDHService;

@Service
public class CGDHServiceImpl implements CGDHService {
	@Autowired
	CGDHDao dao;
	@Override
	public Result queryList(TvPurchaseDetails tvp,int pageNum,int size) {
		/**
		 * 	开启分页
		 */
		PageHelper.startPage(pageNum, size,true);
		List<TvPurchaseDetails> rtnList = dao.queryList(tvp);
		PageInfo<TvPurchaseDetails> pageInfo = new PageInfo<TvPurchaseDetails>(rtnList);
		Result rs = new Result();
		rs.setCode("0");
		rs.setCount(pageInfo.getTotal());
		rs.setData(rtnList);
		return rs;
	}
	/**
	 * 	查询TvPurchaseTemporary信息
	 */
	@Override
	public List<TvPurchaseTemporary> queryType(TvPurchaseDetails tvp) {
		return dao.queryType(tvp);
	}
	/**
	 * 	更改实际到货信息
	 */
	@Override
	public void updTvp(TvPurchaseDetails tvp) {
		dao.updTvp(tvp);
	}
	/**
	 * 	更新库存商品数量
	 */
	@Override
	public void updSTock(TvPurchaseDetails tvp) {
		dao.updSTock(tvp);
	}

}
